﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace webcontent
{
    class Log
    {
        static string filename;

       public Log()
        {
            
           
        }

        static public void log(string text)
        {
            if(filename==null||filename.Equals("")){
                filename = DateTime.Now.ToString();
                filename=filename.Replace('/', '-');
                filename = filename.Replace(':', '-');
            }
            string strLogFilePath = ".\\" + filename + ".log";
            StreamWriter logWriter;
            logWriter = File.AppendText(strLogFilePath);
            logWriter.Write("\r\n"+DateTime.Now.ToString() + ": ");
            logWriter.WriteLine(text);
            logWriter.Close();
        }
    }
}
